import { request } from '@umijs/max';
import { Constants } from '@/constants';
import qs from 'qs';

export async function update1(body: Record<string, any>, options?: { [key: string]: any }) {
  return request(Constants.baseURL + 'api/update1', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    data: qs.stringify(body),
    ...(options || {}),
  });
}

export async function getData(body:Record<string, any>,options?: { [key: string]: any }) {
  return request(Constants.baseURL+'api/getData', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    data: qs.stringify(body),
    ...(options || {}),
  });
}
export async function result(body:Record<string, any>,options?: { [key: string]: any }) {
  return request(Constants.baseURL+'api/result', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    data: qs.stringify(body),
    ...(options || {}),
  });
}
export async function remove(body:Record<string, any>,options?: { [key: string]: any }) {
  return request(Constants.baseURL+'api/remove', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    data: qs.stringify(body),
    ...(options || {}),
  });
}
